<?php
	$stime = microtime(true);
	include "ip.php";
	include "useragent.php";
	$ip = "";
	$useragent = "";
	$content = "";
	$ip = $ips[rand(0,(count($ips)-1))];
	$useragent = $useragents[rand(0,(count($useragents)-1))];
	echo $content = getHtml($ip,$useragent);

	function getHtml($ip,$useragent)
	{
		$url = "https://scholar.google.com/scholar?hl=zh-CN&as_sdt=0%2C5&q=hand&btnG=";
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
		//curl_setopt($ch, CURLOPT_REFERER ,"https://www.ncbi.nlm.nih.gov/pubmed/");
		curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
		curl_setopt($ch, CURLOPT_TIMEOUT, 10);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		//curl_setopt($ch, CURLOPT_HEADER, 1);
		curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
		curl_setopt($ch, CURLOPT_INTERFACE, $ip);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); 
		$content = curl_exec($ch);
		curl_close($ch);
		//print_r($content);
		return $content;
	}
?>

